﻿namespace Net.Share
{
    /// <summary>
    /// 请求超时时间
    /// </summary>
    public readonly struct RequestTimeout
    {
        public readonly uint Timeout;

        public RequestTimeout(uint timeoutMilliseconds)
        {
            Timeout = timeoutMilliseconds;
        }

        public static RequestTimeout To(uint timeoutMilliseconds)
        {
            return new RequestTimeout(timeoutMilliseconds);
        }

        /// <summary>
        /// 等待5秒
        /// </summary>
        public static RequestTimeout FiveSeconds => new(5000);
        /// <summary>
        /// 等待10秒
        /// </summary>
        public static RequestTimeout TenSeconds => new(10000);
        /// <summary>
        /// 等待15秒
        /// </summary>
        public static RequestTimeout FifteenSeconds => new(15000);
    }
}